# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=pam-u2f
pkgver=1.3.0
pkgrel=2
pkgdesc="Pluggable Authentication Module (PAM) for U2F"
url="https://developers.yubico.com/pam-u2f/"
arch="all"
license="BSD-2-Clause"
makedepends="linux-pam-dev openssl-dev>3 libfido2-dev"
options="!check" # need yubikey plugged in on live machine
subpackages="$pkgname-doc"
source="https://developers.yubico.com/pam-u2f/Releases/pam_u2f-$pkgver.tar.gz"
builddir="$srcdir/pam_u2f-$pkgver"

# secfixes:
#   1.1.1-r0:
#     - CVE-2021-31924

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-pam-dir=/lib/security
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
03c09601f1988dd7f6b0cb4eeb6e9f2368de50df2cb8e2b4269e16c8111b08b2d115e6fad7bbca3482e9577ccf2885ab3fef652d9fb99db7890ba93ce6c0fd4d  pam_u2f-1.3.0.tar.gz
"
